package cn.edu.java.stream.泛型;


// 定义一个泛型接口
interface MyGenericInterface<T> {
    void performAction(T item);
}

// 实现泛型接口
class MyStringGenericInterface implements MyGenericInterface<String> {
    @Override
    public void performAction(String item) {
        System.out.println("Performing action on string: " + item);
    }
}

class MyIntegerGenericInterface implements MyGenericInterface<Integer> {
    @Override
    public void performAction(Integer item) {
        System.out.println("Performing action on integer: " + item);
    }
}

public class InterfaceDemo {
    public static void main(String[] args) {
        MyGenericInterface<String> stringInterface = new MyStringGenericInterface();
        stringInterface.performAction("Hello");

        MyGenericInterface<Integer> integerInterface = new MyIntegerGenericInterface();
        integerInterface.performAction(123);
    }
}
